﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace T4MVCGen.Core.Persistence
{
    public interface IJsonRepository<TEntity, TKey>
    {
        System.Linq.IQueryable<TEntity> All<TEntity>();
        string DataPath { get; }
        void Delete<TEntity, TKey>(TKey key);
        void Delete<TEntity>(TEntity item);
        void DeleteAll<TEntity>();
        bool Exists<TEntity, TKey>(TKey key);
        bool Exists<TEntity>(string key);
        void Save<TEntity>(TEntity item);
        void Save<TEntity>(TEntity item, string key);
        TEntity Single<TEntity, TKey>(TKey key);
        TEntity Single<TEntity>(string key);

    }
}
